<!DOCTYPE html>
<html>
<head>
<title>README.md</title>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">

<style>
/* https://github.com/microsoft/vscode/blob/master/extensions/markdown-language-features/media/markdown.css */
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

body {
	font-family: var(--vscode-markdown-font-family, -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif);
	font-size: var(--vscode-markdown-font-size, 14px);
	padding: 0 26px;
	line-height: var(--vscode-markdown-line-height, 22px);
	word-wrap: break-word;
}

#code-csp-warning {
	position: fixed;
	top: 0;
	right: 0;
	color: white;
	margin: 16px;
	text-align: center;
	font-size: 12px;
	font-family: sans-serif;
	background-color:#444444;
	cursor: pointer;
	padding: 6px;
	box-shadow: 1px 1px 1px rgba(0,0,0,.25);
}

#code-csp-warning:hover {
	text-decoration: none;
	background-color:#007acc;
	box-shadow: 2px 2px 2px rgba(0,0,0,.25);
}

body.scrollBeyondLastLine {
	margin-bottom: calc(100vh - 22px);
}

body.showEditorSelection .code-line {
	position: relative;
}

body.showEditorSelection .code-active-line:before,
body.showEditorSelection .code-line:hover:before {
	content: "";
	display: block;
	position: absolute;
	top: 0;
	left: -12px;
	height: 100%;
}

body.showEditorSelection li.code-active-line:before,
body.showEditorSelection li.code-line:hover:before {
	left: -30px;
}

.vscode-light.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(0, 0, 0, 0.15);
}

.vscode-light.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(0, 0, 0, 0.40);
}

.vscode-light.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-dark.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 255, 255, 0.4);
}

.vscode-dark.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 255, 255, 0.60);
}

.vscode-dark.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

.vscode-high-contrast.showEditorSelection .code-active-line:before {
	border-left: 3px solid rgba(255, 160, 0, 0.7);
}

.vscode-high-contrast.showEditorSelection .code-line:hover:before {
	border-left: 3px solid rgba(255, 160, 0, 1);
}

.vscode-high-contrast.showEditorSelection .code-line .code-line:hover:before {
	border-left: none;
}

img {
	max-width: 100%;
	max-height: 100%;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:focus,
input:focus,
select:focus,
textarea:focus {
	outline: 1px solid -webkit-focus-ring-color;
	outline-offset: -1px;
}

hr {
	border: 0;
	height: 2px;
	border-bottom: 2px solid;
}

h1 {
	padding-bottom: 0.3em;
	line-height: 1.2;
	border-bottom-width: 1px;
	border-bottom-style: solid;
}

h1, h2, h3 {
	font-weight: normal;
}

table {
	border-collapse: collapse;
}

table > thead > tr > th {
	text-align: left;
	border-bottom: 1px solid;
}

table > thead > tr > th,
table > thead > tr > td,
table > tbody > tr > th,
table > tbody > tr > td {
	padding: 5px 10px;
}

table > tbody > tr + tr > td {
	border-top: 1px solid;
}

blockquote {
	margin: 0 7px 0 5px;
	padding: 0 16px 0 10px;
	border-left-width: 5px;
	border-left-style: solid;
}

code {
	font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback";
	font-size: 1em;
	line-height: 1.357em;
}

body.wordWrap pre {
	white-space: pre-wrap;
}

pre:not(.hljs),
pre.hljs code > div {
	padding: 16px;
	border-radius: 3px;
	overflow: auto;
}

pre code {
	color: var(--vscode-editor-foreground);
	tab-size: 4;
}

/** Theming */

.vscode-light pre {
	background-color: rgba(220, 220, 220, 0.4);
}

.vscode-dark pre {
	background-color: rgba(10, 10, 10, 0.4);
}

.vscode-high-contrast pre {
	background-color: rgb(0, 0, 0);
}

.vscode-high-contrast h1 {
	border-color: rgb(0, 0, 0);
}

.vscode-light table > thead > tr > th {
	border-color: rgba(0, 0, 0, 0.69);
}

.vscode-dark table > thead > tr > th {
	border-color: rgba(255, 255, 255, 0.69);
}

.vscode-light h1,
.vscode-light hr,
.vscode-light table > tbody > tr + tr > td {
	border-color: rgba(0, 0, 0, 0.18);
}

.vscode-dark h1,
.vscode-dark hr,
.vscode-dark table > tbody > tr + tr > td {
	border-color: rgba(255, 255, 255, 0.18);
}

</style>

<style>
/* Tomorrow Theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */

/* Tomorrow Comment */
.hljs-comment,
.hljs-quote {
	color: #8e908c;
}

/* Tomorrow Red */
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
	color: #c82829;
}

/* Tomorrow Orange */
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
	color: #f5871f;
}

/* Tomorrow Yellow */
.hljs-attribute {
	color: #eab700;
}

/* Tomorrow Green */
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
	color: #718c00;
}

/* Tomorrow Blue */
.hljs-title,
.hljs-section {
	color: #4271ae;
}

/* Tomorrow Purple */
.hljs-keyword,
.hljs-selector-tag {
	color: #8959a8;
}

.hljs {
	display: block;
	overflow-x: auto;
	color: #4d4d4c;
	padding: 0.5em;
}

.hljs-emphasis {
	font-style: italic;
}

.hljs-strong {
	font-weight: bold;
}
</style>

<style>
/*
 * Markdown PDF CSS
 */

 body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "Meiryo";
	padding: 0 12px;
}

pre {
	background-color: #f8f8f8;
	border: 1px solid #cccccc;
	border-radius: 3px;
	overflow-x: auto;
	white-space: pre-wrap;
	overflow-wrap: break-word;
}

pre:not(.hljs) {
	padding: 23px;
	line-height: 19px;
}

blockquote {
	background: rgba(127, 127, 127, 0.1);
	border-color: rgba(0, 122, 204, 0.5);
}

.emoji {
	height: 1.4em;
}

code {
	font-size: 14px;
	line-height: 19px;
}

/* for inline code */
:not(pre):not(.hljs) > code {
	color: #C9AE75; /* Change the old color so it seems less like an error */
	font-size: inherit;
}

/* Page Break : use <div class="page"/> to insert page break
-------------------------------------------------------- */
.page {
	page-break-after: always;
}

</style>

<script src="https://unpkg.com/mermaid/dist/mermaid.min.js"></script>
</head>
<body>
  <script>
    mermaid.initialize({
      startOnLoad: true,
      theme: document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')
          ? 'dark'
          : 'default'
    });
  </script>
<h1 id="%E5%89%8D%E7%AB%AF%E5%BF%AB%E9%80%9F%E5%BC%80%E5%8F%91%E4%BB%A3%E7%A0%81%E6%A1%86%E6%9E%B6%E4%BD%BF%E7%94%A8%E6%89%8B%E5%86%8C">前端快速开发代码框架使用手册</h1>
<h2 id="%E7%9B%AE%E7%9A%84">目的</h2>
<p>为了让项目组内所有前端开发人员拥有一个统一的，快速的，规范化的代码开发环境。</p>
<h2 id="%E5%BC%80%E5%A7%8B%E4%BD%BF%E7%94%A8">开始使用</h2>
<p>该代码框架，基于 VSCode 深度定制，所有插件源于 VSCode 插件商店</p>
<h3 id="%E5%AE%89%E8%A3%85%E6%8F%92%E4%BB%B6">安装插件</h3>
<p>使用 VSCode 打开该项目后，根据工作区推荐，安装所有插件。插件详情如下：</p>
<p><img src="./guide-img/extensions.png" alt="插件详情"></p>
<h2 id="%E5%90%AF%E5%8A%A8%E9%A1%B9%E7%9B%AE">启动项目</h2>
<h3 id="%E5%AE%89%E8%A3%85%E9%A1%B9%E7%9B%AE%E4%BE%9D%E8%B5%96">安装项目依赖</h3>
<p>此处强烈推荐使用 yarn 包管理器，项目原型也使用 yarn 来管理各种依赖包</p>
<pre class="hljs"><code><div>yarn install
</div></code></pre>
<h3 id="%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E4%B8%8B%E7%9A%84%E7%BC%96%E8%AF%91%E6%88%96%E8%80%85%E7%83%AD%E5%8A%A0%E8%BD%BD">开发环境下的编译或者热加载</h3>
<pre class="hljs"><code><div>yarn serve
</div></code></pre>
<h3 id="%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E6%89%93%E5%8C%85">生产环境打包</h3>
<pre class="hljs"><code><div>yarn build
</div></code></pre>
<h3 id="%E4%BB%A3%E7%A0%81%E6%A3%80%E6%9F%A5%E5%92%8C%E4%BF%AE%E5%A4%8D">代码检查和修复</h3>
<pre class="hljs"><code><div>yarn lint
</div></code></pre>
<h2 id="%E8%BF%9B%E5%85%A5%E5%BC%80%E5%8F%91">进入开发</h2>
<h3 id="%E6%8F%90%E4%BA%A4%E5%89%8D%E6%A3%80%E6%9F%A5">提交前检查</h3>
<p>eslint 等代码检查类插件，会实时检查当前代码中存在的问题，<font color="red">错误</font>类问题，会被拒绝提交入库。<font color="yellow">警告</font>类虽然可以提交，但也需要开发人员仔细核查代码质量，除非开发语言类相关的文件，尽量将问题清零，如下图：<br/>
<img src="./guide-img/issues.png" alt="代码检查"></p>
<h3 id="%E6%8F%90%E4%BA%A4%E4%BB%A3%E7%A0%81">提交代码</h3>
<p>在<font color="red">暂存更改</font>后，使用<font color="blue">ctrl+shift+p</font> 组合键，调出代码提交工具<font color="yellow">Commitizen</font>。进行注释编写，如下图：<br/><img src="./guide-img/commitizen.png" alt="commitizen"><br/>选择插件后，按照下列 5 步骤，进行代码注释编写及提交。<br/></p>
<ol>
<li>选择“提交类型”（必选）<br/>
<img src="./guide-img/lists.png" alt="lists"><br/></li>
<li>书写本次提交影响范围，一般一个功能或者一个 bug 提交一次。（必填）<br/>
<img src="./guide-img/1.png" alt="第一步"><br/></li>
<li>书写一条简短的概括性提交描述<br/>
<img src="./guide-img/2.png" alt="第二步"><br/></li>
<li>书写一条详细的提交描述（选填），如果涉及 gitlab 中的议题，则可在此处标记出议题编号，格式：<font color="red">#143</font>。随后可在相应议题中，看到本次提交相关记录和代码<br/>
<img src="./guide-img/3.png" alt="第三步"><br/></li>
<li>记录一些突破性变化（选填）<br/>
<img src="./guide-img/4.png" alt="第四步"><br/></li>
<li>列出想要关闭的 gitlab 议题<br/>
<font color="orange">此处慎用，由于这里列出的议题编号，会直接导致议题关闭，按照公司规定，测试提出的 bug 单（对应就是 gitlab 中的议题）是必须由测试人员关闭，所以此处列出的编号，要再三确认，是自测或者需求设计类议题，有关闭权限的议题</font></li>
</ol>
<p><img src="./guide-img/5.png" alt="第五步"><br/></p>
<h3 id="gitlab-%E6%8F%90%E4%BA%A4%E5%B1%95%E7%A4%BA">Gitlab 提交展示</h3>
<p>按照要求提交代码后，会在 gitlab 中，看到详细的提交记录，有利于代码回顾时候快速定位代码，如下图：<br/>
<img src="./guide-img/commit.png" alt="代码提交记录"></p>
<h2 id="%E4%BB%A3%E7%A0%81%E8%87%AA%E5%8A%A8%E6%A0%BC%E5%BC%8F%E5%8C%96">代码自动格式化</h2>
<p>安装所有插件后，可实现前端开发常用格式（.vue, .js, .html, .scss, .less, .css, .json 等）的代码文件自动格式化。</p>

</body>
</html>
